package ExcelUtil;

import java.io.IOException;

import jxl.write.WritableSheet;
import jxl.format.Alignment;
import jxl.format.Border;
import jxl.format.BorderLineStyle;
import jxl.format.VerticalAlignment;
import jxl.write.Label;
import jxl.write.WritableCell;
import jxl.write.WritableCellFormat;
import jxl.write.WriteException;
import jxl.write.biff.RowsExceededException;

public class ExcelUtil {
	public static WritableSheet excelTitle(int column, int record, String name,WritableSheet sheet) throws IOException, WriteException{
		WritableCellFormat titleFormat = new WritableCellFormat();
		titleFormat.setAlignment(Alignment.CENTRE);// 셀 가로정렬
		titleFormat.setVerticalAlignment(VerticalAlignment.CENTRE); //셀 세로 정렬
		titleFormat.setBorder(Border.ALL, BorderLineStyle.THIN);
		titleFormat.setWrap(false);
		WritableCell cell = new Label(column,record,name);
		sheet.addCell(cell);
		return sheet;
	}
	
	public static WritableSheet excelCell(int column,int i,String list,WritableSheet sheet) throws RowsExceededException, WriteException{
		WritableCell temp = new Label(column,i,list);
		sheet.addCell(temp);
		return sheet;
	}
}
